/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entityBean;

import entity.Staffs;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author ADMIN
 */
@Stateless
public class StaffsFacade extends AbstractFacade<Staffs> {

    @PersistenceContext(unitName = "Cms_Portal_Source-ejbPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public StaffsFacade() {
        super(Staffs.class);
    }

    public List<Staffs> login(String stname, String stpass) {
        return em.createQuery("SELECT s FROM Staffs s WHERE s.stname = :stname and s.stpass = :stpass").setParameter("stname", stname).setParameter("stpass", stpass).getResultList();
    }

    
}
